#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <unordered_map>
#include <string>
#include <vector>
#include < algorithm >
using namespace std;

class Solution {
public:
    int distinctIntegers(int n) {
        return n == 1 ? 1 : n - 1;
    }

    int maxArea(vector<int>& height) {
        int l = 0, r = height.size() - 1;
        int ans = 0;
        while (l < r) {
            int area = min(height[l], height[r]) * (r - l);
            ans = max(ans, area);
            if (height[l] <= height[r]) {
                ++l;
            }
            else {
                --r;
            }
        }
        return ans;
    }
};


int main()
{
    vector<int> v1 = { 8,6,9,5,6,2,4,1 };

    sort(v1.begin(), v1.end());

    for (auto e : v1)
    {
        cout << e << " ";
    }
    cout << endl;

	return 0;
}